package cn.wolfcode.trip.admin.controller;

import cn.wolfcode.trip.base.query.QuestionQueryObject;
import cn.wolfcode.trip.base.service.IQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("ask")
public class QuestionController {

    @Autowired
    private IQuestionService questionService;

    @RequestMapping("list")
    public String list(@ModelAttribute("qo") QuestionQueryObject qo, Model model){
        model.addAttribute("pageInfo", questionService.query(qo));
        return "askQuestion/list";
    }
}
